<html>
<head><meta charset="utf-8"><title>are `or`s eager? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html">are `or`s eager?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212491936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212491936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cass <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212491936">(Oct 06 2020 at 22:04)</a>:</h4>
<p>if the first condition in an <code>or</code> statement is true, does rust evaluate the second one? sorry if this is just cluttering up zulip, i wasn't sure where else to ask</p>



<a name="212492020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212492020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212492020">(Oct 06 2020 at 22:05)</a>:</h4>
<p>they're short-circuiting.</p>



<a name="212492034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212492034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cass <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212492034">(Oct 06 2020 at 22:05)</a>:</h4>
<p>sweet thanks</p>



<a name="212492233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212492233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212492233">(Oct 06 2020 at 22:07)</a>:</h4>
<p>specifically, <code>a || b</code> short circuits and evaluates to a <code>bool</code>, <code>x | y</code> is bitwise-or and it does <em>not</em> short circuit, and it evaluates to whatever the left hand side's bitwise-or output type is.</p>



<a name="212492293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212492293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212492293">(Oct 06 2020 at 22:08)</a>:</h4>
<p>(<code>s/bitwise-and/bitwise-or/</code>)</p>



<a name="212492329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/are%20%60or%60s%20eager%3F/near/212492329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/are.20.60or.60s.20eager.3F.html#212492329">(Oct 06 2020 at 22:08)</a>:</h4>
<p>right</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>